﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
//using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
//using System.Xml.Linq;
using System.Data.SqlClient;

public partial class estados_NuevoEstado : System.Web.UI.Page
{
    clsConexion conexion = new clsConexion();
    String strConection = ConfigurationManager.AppSettings["cnfConexion"];
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void lnkGuardar_Click(object sender, EventArgs e)
    {
        String insertSql = "INSERT INTO estado_producto "+
                           "      (nombre,descripcion) "+
                           "VALUES " +
                           "      ('"+txtNombre.Text+"','"+txtDescripcion.Text+"')";

        using (SqlConnection cnn = new SqlConnection(strConection))
        {
            cnn.Open();
            SqlCommand cm = new SqlCommand(insertSql, cnn);
            cm.ExecuteNonQuery();
        }
        Response.Redirect("/guatemala-logistic/estados/ListaEstados.aspx");
    }
    protected void lnkCancelar_Click(object sender, EventArgs e)
    {
        Response.Redirect("/guatemala-logistic/estados/ListaEstados.aspx");
    }
}
